using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace HashFoo.NhibTests
{
    [TestClass]
    public class DbEnumConventionTests
    {
        [TestMethod]
        [Description("Tests that a unique constraint is added to the enum internal name")]
        public void UniqueConstraintAddedToInternalName()
        {
            Helpers.NukeDatabase();

            var migrationGenerator = Helpers.CreateDefaultMigrationGenerator();
            var schema = migrationGenerator.GenerateMigration();

            Console.WriteLine(schema.UpScript);
            Assert.IsTrue(schema.UpScript.ToLowerInvariant().Contains("unique"), "expected InternalName to be unique");
            Assert.IsTrue(schema.UpScript.ToLowerInvariant().Contains("not null"), "expected InternalName to be not null");
        }
    }
}